﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DB_NH.DB_Map.ywxt.ProjectBuyRecord
{
    using NHibernate;
    using NHibernate.Mapping.ByCode;
    using NHibernate.Mapping.ByCode.Conformist;

    using DB_NH.DB_Model.ywxt.ProjectBuyRecord;

    public class ProjectBuyRecord_Map : ClassMapping<DB_NH.DB_Model.ywxt.ProjectBuyRecord.ProjectBuyRecord>
    {
        public ProjectBuyRecord_Map()
        {
            //映射ID
            Id(x => x.rec_id, map => map.Length(40));

            Property(x => x.is_valid);
            Property(x => x.create_date);

            Property(x => x.buy_code, map => map.Length(50));
            
            //项目购买记录所属标书购买记录
            ManyToOne(x => x.doc_buy_record, map =>
            {
                map.Column("buy_id");
            });

            //项目购买记录所属投标联系人
            ManyToOne(x => x.ent_linker, map =>
            {
                map.Column("ent_user_id");
            });

            //项目购买记录所属项目与投标人关联关系记录
            ManyToOne(x => x.ref_ProjAndEnt, map =>
            {
                map.Column("pe_id");
            });

            Table("t_project_buy_record");

            //不进行创建
            SchemaAction(NHibernate.Mapping.ByCode.SchemaAction.None);
        }
    }
}
